package com.lsh.payment.core.service.bill;

import com.lsh.base.common.utils.CollectionUtils;
import com.lsh.payment.core.dao.bill.ThirdPayDetailDao;
import com.lsh.payment.core.model.bill.ThirdPayDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by wuhao on 2019/10/18.
 */

@Service
public class BillQueryService {
    @Autowired
    ThirdPayDetailDao thirdPayDetailDao;



    public List<ThirdPayDetail> getDetailBypayType(String payType,Long begin,Long end){
        Map<String,Object> queryMap = new HashMap<>();
        queryMap.put("payType",payType);
        queryMap.put("begin",begin);
        queryMap.put("end", end);
        List<ThirdPayDetail> thirdPayDetails = thirdPayDetailDao.getThirdPayDetailList(queryMap);

        if(CollectionUtils.isEmpty(thirdPayDetails)){
            return new ArrayList<>();
        }else {
            return thirdPayDetails;
        }
    }

    public List<ThirdPayDetail> getDetailBills(Long begin,Long end){
        Map<String,Object> queryMap = new HashMap<>();
        queryMap.put("begin",begin);
        queryMap.put("end", end);
        List<ThirdPayDetail> thirdPayDetails = thirdPayDetailDao.getThirdPayDetailList(queryMap);

        if(CollectionUtils.isEmpty(thirdPayDetails)){
            return new ArrayList<>();
        }else {
            return thirdPayDetails;
        }
    }
}
